/*
 * Copyright (C) 2010-2011 Comcast Cable.  All Rights Reserved.
 */
package com.hercules.android.receiver.model.commands;

/**
 * <p>This is a subclass of XRECommand that represents a RESTART XRE command. It defines some properties specific to
 * this command. According to XRE protocol specification, this command is used for terminating and reestablishing the
 * current XRE connection. It is a simple JavaBean (POJO) that provides getters and setters for all private attributes
 * and performs no argument validation in the setters.</p>
 *
 * <p><strong>Thread safety:</strong> This class is mutable and not thread safe.</p>
 *
 * @author saarixx, jmn
 * @version 1.0
 */
public class XRERestartCommand extends XRECommand {

    /**
     * <p>The command name associated with this class.</p>
     *
     * <p>Immutable string constant.</p>
     *
     * <p>Is used in getCommand().</p>
     */
    public static final String COMMAND_NAME = "RESTART";

    /**
     * <p>The reason for terminating and re-establishing the connection.</p>
     *
     * <p>Can be any value.</p>
     *
     * <p>Has getter and setter.</p>
     */
    private String reason;

    /**
     * <p>The status code indicating the reason for the restart.</p>
     *
     * <p>Can be any value.</p>
     *
     * <p>Has getter and setter.</p>
     */
    private int statusCode;

    /**
     * <p>Creates new instance of {@link XRERestartCommand} class.</p>
     */
    public XRERestartCommand() {
        // empty constructor
    }

    /**
     * <p>Retrieves the name of this command.</p>
     *
     * @return the name of this command
     */
    public String getCommand() {
        return COMMAND_NAME;
    }

    /**
     * <p>Retrieves the reason for terminating and re-establishing the connection.</p>
     *
     * @return the reason for terminating and re-establishing the connection
     */
    public String getReason() {
        return reason;
    }

    /**
     * <p>Sets the reason for terminating and re-establishing the connection.</p>
     *
     * @param reason the reason for terminating and re-establishing the connection
     */
    public void setReason(String reason) {
        this.reason = reason;
    }

    /**
     * <p>Retrieves the status code indicating the reason for the restart.</p>
     *
     * @return the status code indicating the reason for the restart
     */
    public int getStatusCode() {
        return statusCode;
    }

    /**
     * <p>Sets the status code indicating the reason for the restart.</p>
     *
     * @param statusCode the status code indicating the reason for the restart
     */
    public void setStatusCode(int statusCode) {
        this.statusCode = statusCode;
    }
}

